#include <mutex>
#include <iostream>

template<class T>
class Unique_Lock
{
public:
    Unique_Lock(T& mtx)
    :_mtx(mtx)
    {
        std::cout << "lock" << std::endl;
        _mtx.lock();
    }

    ~Unique_Lock()
    {
        std::cout << "unlock" << std::endl;
        _mtx.unlock();
    }

    void Lock()
    {
        std::cout << "lock" << std::endl;
        _mtx.lock();
    }

    void UnLock()
    {
        std::cout << "unlock" << std::endl;
        _mtx.unlock();
    }

private:
    Unique_Lock(const Unique_Lock&) = delete;
    Unique_Lock& operator=(const Unique_Lock&) = delete;

private:
    T& _mtx;
};